package com.nuhu.controller;

import com.nuhu.pojo.ComplaintRecord;
import com.nuhu.service.ComplaintRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ComplaintRecordController {
    @Autowired
    private ComplaintRecordService complaintRecordService;

    @PostMapping("/complaint1")
    public String complaintInsert(@RequestBody ComplaintRecord complaintRecord){
        complaintRecordService.complaintInsert(complaintRecord);
        return "投诉记录提交成功，请耐心等待客服回复";
    }

    @PostMapping("/complaint2")
    public String complaintSetIssueResolved(@RequestBody ComplaintRecord complaintRecord){
        complaintRecordService.complaintSetIssueResolved(complaintRecord);
        return "Complaint Record Update success";
    }

    @RequestMapping("/complaint3")
    public ComplaintRecord complaintGetIssueResolved(ComplaintRecord complaintRecord){
        return complaintRecordService.complaintGetIssueResolved(complaintRecord);
    }

    @PostMapping("/complaint4")
    public String complaintSetIsSigned(@RequestBody ComplaintRecord complaintRecord){
        complaintRecordService.complaintSetIsSigned(complaintRecord);
        return "Complaint Record Update success";
    }

    @RequestMapping("/complaint5")
    public ComplaintRecord complaintGetIsSigned(ComplaintRecord complaintRecord){
        return complaintRecordService.complaintGetIsSigned(complaintRecord);
    }

    @RequestMapping("/complaint6")
    public ComplaintRecord complaintSelect(){
        return complaintRecordService.complaintSelect();
    }
}
